<?php 
/**
* 
*/
class Tag
{	
	public $tag =[
		'news'=>1,
		'stu'=>1,
		'img'=>0,
		'foreach'=>1
	];

	function __construct(){}

	//[row='2']
	public function _stu($attr,$content)
	{
		$where = isset($attr['where'])?"WHERE {$attr['where']}":'';

$str=<<<php
	<?php
	require_once 'db.php';
	\$sql = "select * from stu $where limit {$attr['row']}";
	\$obj =new Db;
	\$result = \$obj->query(\$sql);
	foreach (\$result as \$field):?> 
		$content;
	<?php endforeach;?>
php;
	return $str;
	}
}
?>